package com.alibaba.citrus.ots.unified.inventory.dto.api.response;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.google.common.collect.Lists;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @description: 单个调拨单详情
 * @author: yuhw
 * @date: 2021年09月14日 17:21
 **/
@Data
public class AllocateOrderDetailsQueryResponse extends BaseResponse{

    private String id;
    /**
     * 调拨单号
     */
    private String code;
    /**
     * 预报单号
     */
    private String allocateApplyOrderCode;
    /**
     * SAP单号
     */
    private String outAllocateOrderId;
    /**
     * 预报单号
     */
    private String allocateApplyOrderId;
    /**
     * 行号
     */
    private String lineNo;
    /**
     * sap调拨单号
     */
//    private String outAllocateOrderLineNo;
//    private String allocateApplyOrderLineNo;
    /**
     * 提报组织id
     */
    private String applyOrgId;
    /**
     * 提报组织
     */
    private String applyOrgName;
    /**
     * 产品组
     */
    private String productGroup;
    /**
     * 状态
     */
    private String status;
    /**
     * 是否直发客户
     */
    private Boolean isDTC;
    /**
     * 是否退单
     */
    private Boolean returnOrder;
    /**
     * 收货仓id
     */
    private String receiveWarehouseId;
    /**
     * 收货仓组织id
     */
    private String receiveWarehouseOrgId;
    /**
     * 发货仓id
     */
    private String shipWarehouseId;
    /**
     * 发货仓组织id
     */
    private String shipWarehouseOrgId;
    /**
     * 客户编码
     */
    private String customer;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 客户地址
     */
    private String customerAddress;
    /**
     * 客户地址名称
     */
    private String customerAddressName;
    /**
     * 物流信息
     */
    private String logisticsInformation;

    /**
     * 更新人
     */
    private String modifier;

    private Date updateTime;



    /**
     * 调拨类型 {@link com.alibaba.citrus.ots.unified.inventory.dto.api.request.AllocateOrderType }
     */
    private Integer type;
    /**
     * 调拨类型描述
     */
    private String typeDesc;

    /**
     * 下拉的
     */
    private List<CommonObject> typeCommonObjects;


    private String productGroupDesc;


    /**
     * 外部单据号 预报单
     */
    private String outAllocateApplyOrderId;


    /**
     * 创建者
     */
    private String creator;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 期望交货日期
     */
    private Date expectedDeliveryDate;
    /**
     * 单据日期
     */
    private Date docDate;
    /**
     * 生效日期
     */
    private Date beginDate;




    /**
     * 是否为退单
     */
    private String returnOrderDesc;
    /**
     * 是否需要还货
     */
    private boolean needBack;
    private String needBackDesc;
    /**
     * 客户
     */
    /**
     * 客户地址
     */
    /**
     * 客户详细地址
     */
    private String customerDetailsAddress;
    /**
     * 发货仓库
     */
    private String shipWarehouseName;

    /**
     * 发货库区
     */
    private String shipAreaId;
    /**
     * 发货库区名称
     */
    private String shipAreaName;
    /**
     * 收货库区
     */
    private String receiveAreaId;
    /**
     * 收货库区名称
     */
    private String receiveAreaName;

    /**
     * 发货仓所属组织
     */
    private String shipWarehouseOrgName;
    /**
     * 收货仓库
     */
    private String receiveWarehouseName;
    /**
     * 收货仓所属组织
     */
    private String receiveWarehouseOrgName;
    /**
     * 运输方式
     */
    private Integer shipMethod;

    private String shipMethodDesc;

    /**
     * 总部内部售达方编号
     */
    private String sapInternalSalesBPCode;
    /**
     * 总部内部送达方编号
     */
    private String sapInternalDeliveryBPCode;
    /**
     * 总部售达方编号
     */
    private String sapSalesBPCode;
    /**
     * 总部送达方编号
     */
    private String sapDeliveryBPCode;
    /**
     * 总部成本中心
     */
    private String sapCostCenter;
    /**
     * 客户采购参考号
     */
    private String sapRefPoNo;

    /**
     * 总部渠道编码
     */
    private String sapChannel;
    /**
     * 总部组织编码
     */
    private String sapSalesOrgId;
    /**
     * 原价
     */
    private String originalPrice;
    /**
     * 折扣
     */
    private String discount;
    /**
     * 合计金额
     */
    private String totalAmount;


    /**
     * 货品明细
     */
    private List<AllocateOrderScItemDetailDTO> allocateOrderScItemDetailDTOS;
    /**
     * 关联出入库单
     */
    private List<InAndOutOfWarehouseOrderDTO> inAndOutOfWarehouseOrderDTOS;
    /**
     * 出库明细
     */
    private List<OutWarehouseDetailDTO> outWarehouseDetailDTOS;
    /**
     * 入库明细
     */
    private List<InWarehouseDetailDTO> inWarehouseDetailDTOS;
    /**
     * 操作日志
     */
    private List<OperationLogDTO> operationLogDTOS;

    public static void main(String[] args) {
        AllocateOrderDetailsQueryResponse allocateOrderDetailsQueryResponse =
                new AllocateOrderDetailsQueryResponse();
//        allocateOrderDetailsQueryResponse.setType();
//        allocateOrderDetailsQueryResponse.setShipWarehouseOrgName();
//        allocateOrderDetailsQueryResponse.setShipWarehouseName();
//        allocateOrderDetailsQueryResponse.setShipMethodId();
//        allocateOrderDetailsQueryResponse.setSapSalesBPCode();
//        allocateOrderDetailsQueryResponse.setSapRefPoNo();

        List<AllocateOrderScItemDetailDTO> allocateOrderScItemDetailDTOS =
                Lists.newArrayList();
        AllocateOrderScItemDetailDTO allocateOrderScItemDetailDTO =
                new AllocateOrderScItemDetailDTO();
        allocateOrderScItemDetailDTOS.add(allocateOrderScItemDetailDTO);

        List<InAndOutOfWarehouseOrderDTO> inAndOutOfWarehouseOrderDTOS =
                Lists.newArrayList();
        InAndOutOfWarehouseOrderDTO inAndOutOfWarehouseOrderDTO =
                new InAndOutOfWarehouseOrderDTO();
        inAndOutOfWarehouseOrderDTOS.add(inAndOutOfWarehouseOrderDTO);

        List<OutWarehouseDetailDTO> outWarehouseDetailDTOS =
                Lists.newArrayList();
        OutWarehouseDetailDTO outWarehouseDetailDTO = new OutWarehouseDetailDTO();
        outWarehouseDetailDTOS.add(outWarehouseDetailDTO);
//        outWarehouseDetailDTOS.add(outWarehouseDetailDTO);

        List<InWarehouseDetailDTO> inWarehouseDetailDTOS = Lists.newArrayList();
        InWarehouseDetailDTO inWarehouseDetailDTO = new InWarehouseDetailDTO();
        inWarehouseDetailDTOS.add(inWarehouseDetailDTO);

        List<OperationLogDTO> operationLogDTOS = Lists.newArrayList();
        OperationLogDTO operationLogDTO = new OperationLogDTO();
        operationLogDTO.setRemarks(Lists.newArrayList("1","2","3"));
        operationLogDTOS.add(operationLogDTO);

        allocateOrderDetailsQueryResponse.setOperationLogDTOS(operationLogDTOS);
        allocateOrderDetailsQueryResponse.setInAndOutOfWarehouseOrderDTOS(inAndOutOfWarehouseOrderDTOS);
        allocateOrderDetailsQueryResponse.setOutWarehouseDetailDTOS(outWarehouseDetailDTOS);
        allocateOrderDetailsQueryResponse.setInWarehouseDetailDTOS(inWarehouseDetailDTOS);
        allocateOrderDetailsQueryResponse.setAllocateOrderScItemDetailDTOS(allocateOrderScItemDetailDTOS);

        System.out.println(JSONObject.toJSONString(allocateOrderDetailsQueryResponse,
                SerializerFeature.WriteMapNullValue));

    }


}
